package com.IR.user.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.IR.shop.mapper.UsersMapper;
import com.IR.shop.po.Users;
import com.IR.shop.po.UsersExample;
@Service
public class BUsersBiz {
	@Resource
	public UsersMapper usersmapper;
	private Users users;
	private List<Users> list;
	
	public Users getUsers() {
		return users;
	}
	public void setUsers(Users users) {
		this.users = users;
	}
	public List<Users> getList() {
		return list;
	}
	public void setList(List<Users> list) {
		this.list = list;
	}
	//�û�ID��ѯ
	public Users showUserId(Long userid) {
		Users user = usersmapper.selectByPrimaryKey(userid);
		return user;
	}
	//��ѯȫ���û�
	public List<Users> findAll(){
		UsersExample user = new UsersExample();
		list=usersmapper.selectByExample(user);
		//System.out.println(list.size());
		return list;
	}
	//��ҳ��ѯ
		public List<Users> showUserPage(int pagenow,int pagesize) {			
			int start=(pagenow-1)*pagesize;//��ʼ����
			UsersExample ue = new UsersExample();
			ue.setOffset(start);
			ue.setLimit(pagesize);
			list = usersmapper.selectByExample(ue);
			return list;
		}
		public Users showUserById(Long userid) {
			//Long userid=111111111l;
			return usersmapper.selectByPrimaryKey(userid);		
		}
}
